home *** CD-ROM | disk | FTP | other *** search
/ Windows News 2010 Summer - Disc 1 / WN_Ete2010_CD1.iso / Onglet5 / Weezo / Weezo setup.exe / {code_appDir} / www / local / newVersion.php < prev    next >
PHP Script  |  2010-05-19  |  3KB  |  85 lines

  1. <?php
  2. /**
  3.  * New weezo version available message box
  4.  *
  5.  *
  6.  *
  7.  * PHP version 5
  8.  *
  9.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  10.  * that is available through the world-wide-web at the following URI:
  11.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  12.  * the PHP License and are unable to obtain it through the web, please
  13.  * send a note to license@php.net so we can mail you a copy immediately.
  14.  *
  15.  * @category   NA
  16.  * @package    NA
  17.  * @author     Nicolas Bruley / Peer 2 World <contact@weezo.net>
  18.  * @copyright  2005-2009 Nicolas Bruley / Peer 2 World
  19.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  20.  * @version    CVS: $Id:$
  21.  * @link       http://www.weezo.net
  22.  * @since      File available since Release 1.0.0
  23.  */
  24.  
  25. // Initialize script data
  26. require_once('localFunctions.php');
  27. lfInit();
  28.  
  29. /**
  30.  * Save preferences
  31.  */
  32. if(isset($_POST['savePrefs']) && ($_POST['savePrefs']=='auto' || $_POST['savePrefs']=='disabled')){
  33.     cfServerSendCommand('changeParameter name="updateApplication" value="'.$_POST['savePrefs'].'"');
  34. }
  35.  
  36. // Udate disabled : quit
  37. if(cfGGetVar('updateApplication')=='disabled'){
  38.     cfInsertHEAD(false);
  39.     echo '</head><body onload="wl.UICommand(\'close\')"></body>';
  40.     exit;
  41. }
  42. // Set default value if not already set
  43. if(!cfGGetVar('updateApplication')) cfGSetVar('updateApplication','confirm');
  44.  
  45.  
  46. cfInsertHEAD(false);
  47. echo '<meta width="440x175"></meta>';
  48. echo '<meta wintitle="Weezo"></meta>';
  49. echo '</head>';
  50. echo '<body oncontextmenu="return false;" onSelect="document.deselForm.desel.select();">';
  51. echo outDivFrame('frame2',false,'margin-top:10px');
  52.  
  53. echo outImage(outIcon('installIcon'),false,false,'float:left; margin-right:1em');
  54. echo cfCaption('newVersionAvailable');
  55. echo '<br/><br/>'.cfCaption('newVersionDownload');
  56. echo '<form name="dontAskForm" method="POST" action="">';
  57.  
  58. // Save / Cancel buttons
  59.     echo '<div style="position:relative; top:-4px; text-align:center; width:100%">'.outButton(cfCaption('genOK'),'javascript:dl();',outIcon('ok'));
  60.     echo '<span style="padding-left:2em;"></span>'.outButton(cfCaption('genCancel'),'javascript:savePrefs();',outIcon('cancel'));
  61.     echo '</div></div>';
  62.  
  63.     echo '<input type="hidden" name="savePrefs" style="display:none;" />';
  64.     echo '<input type="checkbox" name="dontAsk" style="margin-top:3px; margin-right:1em;" /><span>'.cfCaption('dontAskAnymore').'</span>';
  65.  
  66. echo '</form>';
  67.  
  68. if(isset($_GET['dlAdress'])) $adress=$_GET['dlAdress']; else $adress=DNS_SITE.'/download.php';
  69. $adress.="?lng=".cfGGetVar('language');
  70.  
  71. ?>
  72. <script type="text/javascript" language="javascript">
  73. function dl(){
  74.     W.open("<?php echo $adress; ?>");
  75.     wl.UICommand('close');
  76. }
  77. function doCancel(){
  78.     if(!dgn("dontAsk").checked) wl.UICommand('close');
  79.     else {
  80.         dgn("savePrefs").value="disabled";
  81.         D.dontAskForm.submit();
  82.     }
  83. }
  84. </script>
  85. </body></html>